package com.qf.shop.service.Impl;



import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.qf.shop.entity.SysUser;
import com.qf.shop.entity.User;
import com.qf.shop.mapper.SysUserMapper;
import com.qf.shop.model.TableData;
import com.qf.shop.pojo.QueryUser;
import com.qf.shop.service.ISysUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ Author     ：lzq.
 * @ Date       ：Created in 9:20 2020/10/24
 */
@Service
@Transactional
public class SysUserServiceImpl implements ISysUserService {
private SysUserMapper sysUserMapper;

    public SysUserServiceImpl(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }

    @Override
    public Integer chewSysLogin(String username, String password) {
        return sysUserMapper.chewSysLogin(username,password);
    }

    @Override
    public List<SysUser> getAllSysData(Integer id,String name, String password) {
        return sysUserMapper.getAllSysData(id, name,  password);
    }

    @Override
    public Integer insert(SysUser sysUser) {
//        String password = sysUser.getPassword();
//        sysUser.setPassword(DigestUtils.md5Hex(password));
        return sysUserMapper.insert(sysUser);
    }

    @Override
    public SysUser selectById(Integer id) {
        return sysUserMapper.selectById(id);
    }

    @Override
    public Integer deleteById(Integer id) {
        return sysUserMapper.deleteById(id);
    }


}
